<template>
  <div id="headerId">
    <div class="header-time">
      <span class="font-color">北京时间：{{ currentTime }}</span>
    </div>
    <div class="header-title">
      <span class="icon icon-diqiu myicon header-logo"></span>
      <span class="header-text">反卫星作战推演系统</span>
    </div>
    <div class="right-wrap">
      <span class="font"
        >仿真时间：<span>{{  simulationTime }}</span></span
      >
    </div>
  </div>
</template>

<script>
import { getUTCTime } from "../utils/utils";

export default {
  components: {},
  props: {
    simulationTime: {
      type: String,
      default: "0000-00-00 00:00:00",
    }
  },
  data() {
    return {
      currentTime: "",
      timer: null,
    };
  },
  mounted() {
    this.timer = setInterval(() => {
      this.currentTime = getUTCTime();
    }, 1000);
  },
  beforeDestroy() {
    if (this.timer) clearInterval(this.timer);
  },
  methods: {},
};
</script>

<style scoped>
#headerId {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 61px;
  line-height: 60px;
  z-index: 100;
  color: #fff;
  background-color: #11171db3;
  background: url("@/assets/system-title.png") no-repeat;
  background-size: 100% 100%;
  border-bottom: 1px solid #4897c5;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: content-box;
}
.header-time {
  width: 35%;
  color: #ffffff;
  align-items: center;
  justify-content: flex-start;
  display: flex;
  font-size: 24px;
  font-weight: bold;
  height: 60px;
  line-height: 60px;
  box-sizing: border-box;
  padding-left: 48px;
}
.font-color {
  color: transparent;
  background-image: linear-gradient(45deg, #ffbb21, #f3f709);
  -webkit-background-clip: text;
}
.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30%;
}

.header-logo {
  height: 60px;
  line-height: 60px;
  margin-right: 60px;
}

.header-text {
  font-weight: 500;
  letter-spacing: 10px;
  color: #4897c5;
  font-size: 32px;
  font-weight: 600;
  color: #249ef7;
  color: #97c8ec;
  font-family: "微软雅黑";
  align-items: center;
  transform: translateX(-10%);
}

.timebar {
  width: 50%;
  height: 48px;
  line-height: 48px;
  float: right;
  right: 10px;
  display: inline-flex;
}

.myicon {
  color: #1a8bed;
  font-size: 40px;
  font-weight: 500;
}
.right-wrap {
  width: 35%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.font {
  font-size: 23px;
  margin-right: 10px;
  font-weight: bold;
  color: transparent;
  background-image: linear-gradient(45deg, #f0b52c, #f3f709);
  -webkit-background-clip: text;
}
.speed {
  margin: 0 12px;
}
</style>
